package com.dy.system.mapper;

import com.dy.basic.mapper.BaseMapper;
import com.dy.system.domain.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dayong
 * @since 2023-03-09
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    // 根据sn 查询权限
    Permission loadBySn(String permissionSn);

    // 添加role-permission的信息
    void addRolePerm(@Param("ids") Long id, @Param("perms") List<Long> permissions);

    // 删除role-permission的信息
    void deleteByPerId(Long id);


    Long findByRoleId(Long id);

    // 删除中间表的信息
    void deleteBypermissionId(Long permissionId);

    // 获取logininfoId查询用户所拥有的权限
    List<String> loadOwnPermissionByLogininId(Long id);
}
